package com.zhangchong.testandroid.modules;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.zhangchong.testandroid.base.BaseActivity;
import com.zhangchong.testandroid.R;

public class MainActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Button
        Button button = findViewById(R.id.button);

        // Way 1
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.i("MainActivity", "下一页");
                Intent intent = new Intent(MainActivity.this, ButtonActivity.class);
                startActivity(intent);
            }
        });

        // Way 2
//        button.setOnClickListener((View v) -> {
//            Intent intent = new Intent(MainActivity.this, LinearActivity.class);
//            startActivity(intent);
//        });

        // Way 3
//        button.setOnClickListener(v -> startActivity(new Intent(MainActivity.this, LinearActivity.class)));

    }

}